// simulated_ukey.h
#ifndef SIMULATED_UKEY_H
#define SIMULATED_UKEY_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

// 模拟UKey设备结构
typedef struct {
    char device_name[32];
    int is_connected;
    unsigned char sm2_prikey[32];
    unsigned char sm2_pubkey[64];
} SimulatedUKey;

// 模拟UKey函数声明
int UKey_Initialize(SimulatedUKey *ukey);
int UKey_SM2_Encrypt(SimulatedUKey *ukey, const unsigned char *plaintext, int len, unsigned char *ciphertext);
int UKey_SM2_Decrypt(SimulatedUKey *ukey, const unsigned char *ciphertext, int len, unsigned char *plaintext);
int UKey_SM3_Hash(SimulatedUKey *ukey, const unsigned char *data, int len, unsigned char *hash);
int UKey_SM4_Encrypt(SimulatedUKey *ukey, const unsigned char *key, const unsigned char *plaintext, int len, unsigned char *ciphertext);
int UKey_SM4_Decrypt(SimulatedUKey *ukey, const unsigned char *key, const unsigned char *ciphertext, int len, unsigned char *plaintext);
void UKey_Cross_Verification();

// 简单的SM3函数声明（基于你之前的代码）
void SM3_256(unsigned char buf[], int len, unsigned char hash[]);

#endif
